IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetProtocolDocumentIncludeEditableList]') AND type in (N'P', N'PC')) 
DROP PROCEDURE [dbo].[GetProtocolDocumentIncludeEditableList] 
GO 

SET ANSI_NULLS ON 
GO 

SET QUOTED_IDENTIFIER OFF 
GO 

/*************************************************************************** 
* Name: GetProtocolDocumentIncludeEditableList 
* Purpose: get the IncludeEditable field of protocolDocument 
* 
* PARAMETERS 
* Name Description 
* ------------- ----------------------------------------------------------- 
* @protocolId id of the Protocol 
***************************************************************************/ 
CREATE PROCEDURE [dbo].[GetProtocolDocumentIncludeEditableList] 
( 
	@protocolId INT
) 
AS 
	BEGIN 

	SET NOCOUNT ON 

	IF (ISNULL(@protocolId, 0) <> 0 ) 
	BEGIN 
		SELECT Id  
		FROM ProtocolDocument 
		WHERE [ProtocolId] = @protocolId and IncludeEditable = 1	--is not null 
	END 

  SET NOCOUNT OFF 

END 


